package com.struts.web.corpor.manage.system;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import org.apache.struts.action.ActionMessages;

import com.base.Constants;
import com.lg.system.CLGAction;
import com.struts.deal.corpor.manage.system.SysDeal;
import com.struts.web.user.manage.system.EditPassForm;

public class EditPassAction extends CLGAction {
      
	
	public ActionForward execute(ActionMapping actionMapping,
            ActionForm actionForm,
            HttpServletRequest request,
            HttpServletResponse response) throws Exception {
		EditPassForm aWebForm = (EditPassForm)actionForm;
		ActionMessages msgs = new ActionMessages();
		boolean result = false;
		
		result=SysDeal.modiPass(request, response, aWebForm);
		if(result){
			return actionMapping.findForward("nbsuccess");
		}else{
			msgs.add("commonMsgs",new ActionMessage(Constants.WRONG_PASS));
			saveErrors(request,msgs);
			return actionMapping.findForward("nbfail");
		}
		
	 }
	
}
